package com.cskaoyan.controller;

import com.cskaoyan.service.AccountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author stone
 * @date 2022/04/02 17:13
 */
@RestController
@RequestMapping("account")
public class AccountController {
    @Autowired
    AccountService accountService;

    @RequestMapping("transfer")
    public String transfer(Integer fromId,Integer destId,double money) {
        Logger logger = LoggerFactory.getLogger(AccountController.class);

        logger.debug("debug level");
        logger.info("info level");
        logger.warn("warn level");
        logger.error("error level");

        accountService.transfer(fromId, destId, money);
        return "OK";
    }
}
